This invention relates to texture mapping computer graphics systems and, more particularly, to methods and apparatus for color texture processing which provide high fidelity 3-D graphics rendering.
Many imaging systems produce data representing physical entities or properties in three-dimensional space. Examples include CAT scans, MRI scans, ultrasound images and seismic test images. The process of converting the three-dimensional arrays of data into two-dimensional image displays is referred to as volume rendering. The term xe2x80x9cvoxel processingxe2x80x9d is also used, because the 3-D space is ordinarily broken down into small volumes, referred to as voxels. Each voxel has optical properties, ordinarily expressed in terms of opacity (or its complement, transparency) and color (or gray scale in black and white imaging systems). These properties contribute to the overall image when it is to be computed by mathematical projection and sampling and converted into pixels to be displayed on a two-dimensional display surface.
The computation-intensive nature of graphics has driven research in algorithm optimization. An important technique for speed optimization is the use of opacity compositing and multipass rendering to combine independently rendered layers. However, artifacts result when interpolating from textures or images and opacity values separately. A technique which avoids the artifacts in volume rendering is described by C. Wittenbrink et al. in xe2x80x9cOpacity-Weighted Color Interpolation for Volume Sampling,xe2x80x9d IEEE, 1998 Symposium on Volume Visualization, Oct. 19-20, 1998. According to this technique, voxel colors are opacity weighted before interpolation. The authors suggest that the disclosed technique may provide a fix for artifacts which exist in texture mapping graphic systems that use color and opacity textures.
Artifacts that exist in prior art texture mapping graphics systems include color bleeding, aliasing, jagged edges and others. Prior solutions to these artifacts include (1) allow the artifacts, (2) preweight the colors by opacity in the storage of object data, and (3) interpolate materials and not the colors, so that the interpolated material values may be classified to colors and opacities.
A disadvantage of the first approach is that many artifacts are created. Existing graphics hardware uses interpolation of unassociated colors and therefore exhibits the artifacts.
A disadvantage of the second approach is that the precision of representation is reduced, or the amount of storage required is increased. For example, because opacity is a fractional value, from 0 to 1, the weighted color values are scaled down. The scaled down color values cannot as accurately be represented within a fixed bit format, which is used to store the data for graphics rendering. Fixed bit formats are, for example, 8 bits to represent each color component, red, green and blue, for a total of 24 bits.
When opacity weighting is performed, small opacity values force colors to become zero. An alternative way to compensate for this reduction in precision is to increase the word width. The color word widths would have to be enlarged to more bits, for example, 20 bits per color component for red, green and blue for 60 bits total. Existing hardware can have data preweighted, or associated, by multiplication, but the texture and frame buffer storage are fixed point at a reduced precision. This causes artifacts from the low precision. Current graphics APIs, such as Microsoft Direct 3D, propose and use preweighted colors, and because of using the frame buffer storage and texture storage as a fixed point, suffer the errors due to the reduced precision.
A disadvantage of the third approach is that it requires classification from material to color and opacity after interpolation, which means more calculation for rendering, and many data inputs are already colors and opacities, so a material value is not available. This solution has been more prevalent in software systems for volumetric rendering. The post-classification of interpolated material values has an additional disadvantage, wherein the changing viewpoint in rendering, combined with approximate reconstruction filters, means that each view constructs a different material sampling. This creates frame-to-frame aliasing which may not be acceptable to users. The fact that many data sets are already colors, and not materials, means that this solution cannot handle these cases, and something must be done to properly interpolate when the inputs are colors and opacities. Nearly all prior art graphics hardware manipulates color data rather than material values in the fragment and texture interpolation stages.
It is therefore desirable to provide methods and apparatus for color texture processing in computer graphics systems wherein some or all of the foregoing drawbacks are overcome.
According to a first aspect of the invention, texture mapping computer graphics apparatus is provided. The apparatus comprises an associating interpolator circuit for determining first interpolated opacity weighted colors and a first interpolated opacity in response to texture coordinates and a plurality of texture colors and corresponding texture opacities, an associated color compositing circuit for compositing the first interpolated opacity weighted colors and second interpolated opacity weighted colors to provide new opacity weighted colors, an associated opacity compositing circuit for compositing the first interpolated opacity and a second interpolated opacity to provide a new opacity, an unassociating circuit responsive to the new opacity weighted colors and the new opacity for providing unassociated colors, and a frame buffer for storing the unassociated new colors and the new opacity.
The associating interpolator circuit may comprise a weight calculation circuit responsive to the texture coordinates for determining weights corresponding to each of the texture colors, and a plurality of multipliers for multiplying the texture opacities by corresponding ones of the weights to provide weighted opacities. The associating interpolator circuit may further comprise an opacity summing circuit for summing the weighted opacities to provide the first interpolated opacity. The associating interpolator circuit may further comprise, for each color component, a plurality of multipliers for multiplying the texture colors by corresponding ones of the weighted opacities to provide opacity weighted texture colors, and a color summing circuit for summing the opacity weighted texture colors to provide one of the first interpolated opacity weighted colors.
The associated color compositing circuit may comprise, for each color component, a color register for holding one of the second interpolated opacity weighted colors, first and second multiplexers for selecting interpolated opacity weighted colors from the associating interpolator circuit and the color register, and a compositor responsive to the selected interpolated opacity weighted colors and the interpolated opacity for determining the new opacity weighted color. Compositing may be performed from front-to-back or from back-to-front.
The associated opacity compositing circuit may comprise an opacity register for holding the second interpolated opacity, first and second multiplexers for selecting interpolated opacities from the associating interpolator circuit and the opacity register, and a compositor responsive to the selected interpolated opacities for determining the new opacity.
The unassociating circuit may comprise a circuit for dividing each of the new opacity weighted colors by the interpolated opacity to provide the unassociated new colors.
The new opacity weighted colors may have higher precision than the unassociated new colors. The colors are represented at higher precision in the compositing circuit and are stored at lower precision, thereby permitting a reduction in physical memory and associated buses.
According to another aspect of the invention, a method is provided for performing texture mapping in a computer graphics system. The method comprises the steps of determining first interpolated opacity weighted colors and a first interpolated opacity in response to texture coordinates and a plurality of texture colors and corresponding texture opacities, compositing the first interpolated opacity weighted colors and second interpolated opacity weighted colors to provide new opacity weighted colors, compositing the first interpolated opacity and a second interpolated opacity to provide a new opacity, providing unassociated new colors in response to the new opacity weighted colors and the new opacity, and storing the unassociated new colors and the new opacity in a frame buffer.